<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-for</title>
    <script src="js/vuejs-2.5.16.js"></script>


</head>
<body>
<div id="app">
    <!--遍历数组 -->
    <table width="100%" border="1px">
          v-for位置：在需要遍历的元素父元素中书写
        <tr v-for="(user,index) in users">
            <!--<td >{{index+1}}</td>-->
            <td >{{user.name}}</td>
            <td v-text="user.gender"></td>
            <td v-text="user.age"></td>
        </tr>
    </table>
</div>

<script>
    var app = new Vue({
        el: "#app",
        data:{
              //  定义数组对象  遍历的数据源
            users:[
                {name:'柳岩', gender:'女', age: 20},
                {name:'有哥', gender:'男', age: 30},
                {name:'范冰冰', gender:'女', age: 24},
                {name:'刘亦菲', gender:'女', age: 18},
                {name:'古力娜扎', gender:'女', age: 25}
            ]
        }
    });
</script>

</body>
</html>